package com.xcdh.commons.exception;

import java.util.Collection;

public class XcdhAsser {

    public static void emptyError(Collection<?> c ,  String message){
        if(c == null || c.isEmpty() ){
            throw ServiceException.build(message) ;
        }
    }

    public static void nullError(Object o , String message){
        if(o == null ){
            throw ServiceException.build(message) ;
        }
    }

    public static void tureError(boolean bool , String message){
        if(bool){
           throw  ServiceException.build(message) ;
        }
    }
    public static void falseError(boolean bool , String message){
        if(!bool){
            throw  ServiceException.build(message) ;
        }
    }
}
